


	<div class="block">

	
	
	<div class="invertedshiftdown">
<ul>
	<?php
	if($organization->type=='s'){
	?>
			<li><a href="?page=organization_inventory&id=<?php echo $organization->id; ?>">查看货存</a></li>
			<li><a href="?page=organization_sell&id=<?php echo $organization->id; ?>">出售</a></li>
			<li class="current"><a href="?page=organization_return&id=<?php echo $organization->id; ?>">退款</a></li>
			<li><a href="?page=organization_distribute&id=<?php echo $organization->id; ?>">分配</a></li>
			<li><a href="?page=organization_distribute_confirm&id=<?php echo $organization->id; ?>">处理待定分配</a></li>
			<li><a href="?page=organization_transaction&id=<?php echo $organization->id; ?>">查看物流记录</a></li>
			<li><a href="?page=organization_sell_record&id=<?php echo $organization->id; ?>">查看销售记录</a></li>
	<?php
	}elseif($organization->type=='w'){
	?>
	       	<li><a href="?page=organization_inventory&id=<?php echo $organization->id; ?>">查看库存</a></li>
			<li><a href="?page=organization_stack&id=<?php echo $organization->id; ?>">入库</a></li>
			<li><a href="?page=organization_distribute&id=<?php echo $organization->id; ?>">分配</a></li>
			<li><a href="?page=organization_distribute_confirm&id=<?php echo $organization->id; ?>">处理待定分配</a></li>
			<li><a href="?page=organization_transaction&id=<?php echo $organization->id; ?>">查看物流记录</a></li>
			
    <?php
	}
	?>
</ul>




<form id="myform">
<input type="text" class="textinput" /> <input class="submit" type="submit" value="搜索" />
</form>
</div>

<br style="clear: both;" />

	<div id= 'content'>

	
<h2><?php echo $organization->name?>》退款界面</h2>
	
	
	
	<?php
	//print_r($_GET);
	if(isset($_GET['stat'])){
		if($_GET['stat']=='returned'){
			
		
	
	?>
	<div id="message">
		<h4>操作成功：</h4>退款
	</div>
	
	<?php
		}elseif($_GET['stat']=='error'&&$_GET['error']=='notExist'){
	?>
	<div id="message_error">
		<h4>操作失败：</h4>无法进行退款（选择产品的形码不存在于数据库）
	</div>
	
		<?php
		}elseif($_GET['stat']=='error'&&$_GET['error']=='badData'){
	?>
	<div id="message_error">
		<h4>操作失败：</h4>无法退款（提交了无效数据）
	</div>
<?php

		}
}
?>
	<h4>产品列表：</h4>
		 <form action="api/" method="POST">

	<table class="contentTable" border="1">
		    	

			<tbody><tr class="solid">
				<td>选择</td>
		<td>扫描条码</td>
		<td>生产款号</td>
		<td>设计版号</td>
		<td>类型</td>
        <td>年份</td>
		<td>季节</td>
		<td>流水号</td>
		<td>面料</td>
		<td>色彩</td>
		<td>尺寸</td>
		<td>设计师</td>
		<td>原价</td>
		<td>折率</td>
		<td>现售与否</td>
		<td>产品名</td>
		
		</tr>
	
	
		<?php
	    global $itemType;
			global $itemTopSize;
			global $itemSize;
			global $itemColor;
			global $itemMaterial;
			global $itemSeason;
			global $itemYear;
			global $itemType;
			global $itemDesigner;
			global $organizationType;			
		foreach($allItems as $item){
			
		?>

		<tr>
				<td>
			
          <input type="radio" name="scan_code" value="<?php echo $item->scan_code;?>" checked>

		</td>
		<td><?php echo $item->scan_code;?></td>
		<td><?php echo $item->product_code;?></td>
		<td><?php echo $item->designer_code;?></td>
		<td><?php echo $itemType[$item->type];?></td>
		<td><?php echo $itemYear[$item->year];?></td>
		<td><?php echo $itemSeason[$item->season];?></td>
		<td><?php echo $item->flow;?></td>
		<td><?php echo $itemMaterial[$item->material];?></td>
		<td><?php echo $itemColor[$item->color];?></td>
		<td><?php echo $itemSize[$item->size];?></td>
		<td><?php echo $itemDesigner[$item->designer];?></td>	
		<td><?php echo $item->price;?></td>	
		<td><?php echo $item->ratio."%";?></td>	
		<td><?php echo ($item->active==1) ? '是' : '否';?></td>	
		<td><?php echo $item->name;?></td>
		
	
		</tr>

	
	<?php
		}
	?>
		</tbody></table>
<br>
<br>

	

    
    
    <hr>
   
    	<h4>方法一，选择以上的其中一种产品,然后再填写数量和金额</h4>
    	<div class="important">所退条形码若没能在上面列表找到请联络管理员</div>
    	<br>
    	
    	
    	<input type="hidden" id='action' name="action" value="organization_return" />

        	<input type="hidden" id='id' name="id" value=<?php echo $organization->id;?> />
        	<input type="hidden" id='uid' name="uid" value=<?php echo $currentUser->id;?> />
        	
           <div class="element" style="clear:both;">
              	<input type="radio" name="val" value="unit" checked>单价</input>
              	<input type="radio" name="val" value="total">总价</input>
               <label class="form">金额</label>
             <input type="text" name="amount" value="0.0" >
             </div>
            <div class="element">
             <label class="form">数量</label>
             <input type="text" id="number" name="number" class="text" value="1" >
            </div>
            
            
        <div class="element">
<input type="submit" value="递交" />
        <div class="loading"></div>
    </div>

        
   
    </form>
    <hr>
   <form action="api/" method="POST">
   	  
   
    	<h4>方法二，直接输入扫描条形码</h4>
    	<div class="important">若输入的扫描条形码不在库存中，此出售会失败</div>
        <input type="hidden" id='action' name="action" value="organization_return" />
        <input type="hidden" id='id' name="id" value=<?php echo $organization->id;?> />
        <input type="hidden" id='uid' name="uid" value=<?php echo $currentUser->id;?> />
         <div class="element">
             <label class="form">扫描条形码</label>
             <input type="text" id="scan_code" name="scan_code" class="text" size="14" maxlength="14" >
         </div>
        <div class="element" style="clear:both;">
              	<input type="radio" name="val" value="unit" checked>单价</input>
              	<input type="radio" name="val" value="total">总价</input>
               <label class="form">金额</label>
             <input type="text" name="amount" value="0.0" >
             </div>
            <div class="element">
             <label class="form">数量</label>
             <input type="text" id="number" name="number" class="text" value="1" >
            </div>
            
            
        <div class="element">
<input type="submit" value="递交" />
        <div class="loading"></div>
    </div>
    </form>        	
    
    
    </div>
<div class="clear"></div>
	</div>